package http.secure.common.constant;

import org.dromara.hutool.core.text.StrUtil;

public enum RequestTemplate {
    EXPIRED_REQUEST("URL expired request interception [Request time: {}, System time: {}]"),
    REPEATED_REQUEST("URL repeated request interception [Request time: {}, System time: {}]"),
    INVALID_REQUEST_SIGNATURE("Invalid request signature: {}"),
    IP_ADDRESS_MISMATCH("IP address mismatch"),
    MAX_EXCHANGE_TIME("The time interval between two requests exceeds the maximum limit"),
    PRIVATE_KEY_NOT_FOUND("The correct private key cannot be obtained through the hash"),
    PUBLIC_KEY_SIGNATURE_MISMATCH("Incorrect public key signature"),
    NOT_SUPPORTED_PAYLOAD("Unsupported payload type validation operations: {}"),
    INVALID_HEADER_SIGNATURE("Invalid request header signature"),
    REQUEST_SIGNATURE_NOT_FOUNT("The signature for the current request cannot be found");

    private final String template;

    RequestTemplate(String template) {
        this.template = template;
    }

    public String format(Object... objs) {
        return StrUtil.format(template, objs);
    }
}
